﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    public class OnePrjOneDiscus
    {
        private readonly ElingOA6_Admin_DSJCJ.DAL.OnePrjOneDiscus dal = new ElingOA6_Admin_DSJCJ.DAL.OnePrjOneDiscus();
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus> DataTableToListOnePrjOneDiscus(DataTable dt)
        {
            List<ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus> modelList = new List<ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus GetModel(decimal FOnePrjOneDiscusID)
        {

            return dal.GetModel(FOnePrjOneDiscusID);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public decimal Add(ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus model)
        {
            return dal.Add(model);
        }


        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 批量删除数据 
        /// <creator>chenly</creator>
        /// <date>2013-8-15</date>
        /// </summary>
        /// <param name="idArray">编号数组</param>
        /// <param name="entityNo">公司编号</param>
        public void DeleteMany(string[] idArray)
        {
            dal.DeleteMany(idArray);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="fOnePrjOneDiscusID">一事一议ID</param>
        /// <returns>是否删除</returns>
        public bool Delete(decimal fOnePrjOneDiscusID)
        {

            return dal.Delete(fOnePrjOneDiscusID);
        }


        /// <summary>
        /// 获得多条图片存放路径
        /// </summary>
        /// <param name="strAdCds">编号字符</param>
        /// <param name="strEntityNo">编号字符</param>
        /// <returns>编号字符</returns>
        public List<string> GetSrvName(string id, string strEntityNo)
        {
            return dal.GetSrvName(id, strEntityNo);
        }
        /// <summary>
        /// 获得多条图片存放路径
        /// </summary>
        /// <param name="strAdCds">编号字符</param>
        /// <param name="strEntityNo">公司编号</param>
        /// <returns>集合</returns>
        public List<string> GetManySrvName(string[] ids, string strEntityNo)
        {
            return dal.GetSrvName(ids, strEntityNo);
        }

        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Check(ElingOA6_Admin_DSJCJ.Model.OnePrjOneDiscus model)
        {
            return dal.Check(model);
        }

    }
}
